//
// CTileFarBank.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CTileFarBank {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CTileFarBank(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTileFarBank obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTileFarBank(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CTileFarBank() {
    this(nel3dJNI.new_CTileFarBank(), true);
  }

  public int getNumTile() {
    return nel3dJNI.CTileFarBank_getNumTile(swigCPtr, this);
  }

  public void setNumTile(int numTile) {
    nel3dJNI.CTileFarBank_setNumTile(swigCPtr, this, numTile);
  }

  public SWIGTYPE_p_NL3D__CTileFarBank__CTileFar getTile(int tile) {
    long cPtr = nel3dJNI.CTileFarBank_getTile__SWIG_0(swigCPtr, this, tile);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CTileFarBank__CTileFar(cPtr, false);
  }

  public static long getFarTileEdgeSize(CTileFarBank.TFarOrder order) {
    return nel3dJNI.CTileFarBank_getFarTileEdgeSize(order.swigValue());
  }

  public void serial(IStream f) {
    nel3dJNI.CTileFarBank_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void set_TileVector(SWIGTYPE_p_std__vectorT_NL3D__CTileFar_t value) {
    nel3dJNI.CTileFarBank__TileVector_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CTileFar_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CTileFar_t get_TileVector() {
    long cPtr = nel3dJNI.CTileFarBank__TileVector_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CTileFar_t(cPtr, false);
  }

  public static int get_Version() {
    return nel3dJNI.CTileFarBank__Version_get();
  }

  public final static class TFarOrder {
    public final static TFarOrder order0 = new TFarOrder("order0", nel3dJNI.CTileFarBank_order0_get());
    public final static TFarOrder order1 = new TFarOrder("order1", nel3dJNI.CTileFarBank_order1_get());
    public final static TFarOrder order2 = new TFarOrder("order2", nel3dJNI.CTileFarBank_order2_get());
    public final static TFarOrder orderCount = new TFarOrder("orderCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TFarOrder swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TFarOrder.class + " with value " + swigValue);
    }

    private TFarOrder(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TFarOrder(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TFarOrder(String swigName, TFarOrder swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TFarOrder[] swigValues = { order0, order1, order2, orderCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TFarType {
    public final static TFarType diffuse = new TFarType("diffuse", nel3dJNI.CTileFarBank_diffuse_get());
    public final static TFarType additive = new TFarType("additive", nel3dJNI.CTileFarBank_additive_get());
    public final static TFarType alpha = new TFarType("alpha", nel3dJNI.CTileFarBank_alpha_get());
    public final static TFarType typeCount = new TFarType("typeCount", nel3dJNI.CTileFarBank_typeCount_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TFarType swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TFarType.class + " with value " + swigValue);
    }

    private TFarType(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TFarType(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TFarType(String swigName, TFarType swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TFarType[] swigValues = { diffuse, additive, alpha, typeCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
